﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" Inherits="Pages_Agent_AgentItem" Codebehind="AgentItem.aspx.cs" %>

<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="Server">
    <a href="AgentList.aspx" title="Back Button"><span id="backbutton">Back</span></a>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server">
    <div style="margin: 10px 3px 0 3px">
        <h1 style="text-indent: 10px">
            Add / Edit Agent</h1>
        <div style="margin: 15px">
            <div class="item">
                <div class="label">
                    Agent#:</div>
                <div class="field">
                    <asp:TextBox ID="txtGuestID" runat="server"></asp:TextBox>
                    <asp:Label ID="lblAlert" runat="server" ForeColor="Red" Visible="false">This Agent exist! </asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="This field is required."
                        InitialValue="" ControlToValidate="txtGuestID"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    Company name:</div>
                <div class="field">
                    <asp:TextBox ID="txtCompanyName" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Assigned user:</div>
                <div class="field">
                    <asp:DropDownList ID="ddlUserName" runat="server" AppendDataBoundItems="true">
                        <asp:ListItem class="firstItem" Value="00000000-0000-0000-0000-000000000000">Choose a user ...</asp:ListItem>
                    </asp:DropDownList>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    Title:</div>
                <div class="field">
                    <asp:DropDownList ID="ddlTitle" runat="server">
                        <asp:ListItem>Ms.</asp:ListItem>
                        <asp:ListItem>Mr.</asp:ListItem>
                        <asp:ListItem>Mrs.</asp:ListItem>
                    </asp:DropDownList>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    First name:</div>
                <div class="field">
                    <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox></div>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="*"
                    InitialValue="" ControlToValidate="txtFirstName"></asp:RequiredFieldValidator>
            </div>
            <div class="item">
                <div class="label">
                    Last name:</div>
                <div class="field">
                    <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox></div>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*"
                    InitialValue="" ControlToValidate="txtLastName"></asp:RequiredFieldValidator>
            </div>
            <div class="item">
                <div class="label">
                    Address line 1:</div>
                <div class="field">
                    <asp:TextBox ID="txtAddressLine1" Width="350px" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Address line 2:</div>
                <div class="field">
                    <asp:TextBox ID="txtAddressLine2" Width="350px" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Country:</div>
                <div class="field">
                    <asp:DropDownList ID="ddlCountry" runat="server" AppendDataBoundItems="true">
                        <asp:ListItem CssClass="firstItem" Text="Choose a country ... " Value=""></asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                        InitialValue="" ControlToValidate="ddlCountry"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    ZipCode:</div>
                <div class="field">
                    <asp:TextBox ID="txtZipCode" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    City:</div>
                <div class="field">
                    <asp:TextBox ID="txtCity" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Email:</div>
                <div class="field">
                    <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Website:</div>
                <div class="field">
                    <asp:TextBox ID="txtWebsite" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Tel.:</div>
                <div class="field">
                    <asp:TextBox ID="txtTel" runat="server"></asp:TextBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Fax:</div>
                <div class="field">
                    <asp:TextBox ID="txtFax" runat="server"></asp:TextBox></div>
            </div>
            <div class="item" style="display: none">
                <div class="label">
                    Active:</div>
                <div class="field">
                    <asp:CheckBox ID="cbActive" CssClass="checkbox" runat="server"></asp:CheckBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Note:</div>
                <div class="field">
                    <asp:TextBox ID="txtNote" runat="server"></asp:TextBox></div>
            </div>
            <div>
                <asp:GridView ID="grv" runat="server" AutoGenerateColumns="False" CssClass="grid"
                    CellPadding="4" Width="100%">
                    <RowStyle BackColor="White" ForeColor="#330099" />
                    <Columns>
                        <asp:TemplateField HeaderText="AgentID">
                            <ItemTemplate>
                                <%#Eval("AgentID") %>
                                <asp:HiddenField ID="hdfAgentPricesId" runat="server" Value='<%#Eval("Id") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="PriceType">
                            <ItemTemplate>
                                <%#Eval("PriceType") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="TypeOfCabin">
                            <ItemTemplate>
                                <%#Eval("TypeOfCabin") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Route">
                            <ItemTemplate>
                                <%#Eval("Route") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Boat">
                            <ItemTemplate>
                                <%#Eval("Boat") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Price">
                            <ItemTemplate>
                                <asp:TextBox ID="txtPrice" runat="server" Text='<%#Eval("Price") %>' Width="100"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtPrice"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtPrice" ValidationExpression="^\d*[0-9]$" SetFocusOnError="true"></asp:RegularExpressionValidator>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="gridheader" />
                    <RowStyle CssClass="gridrow" />
                    <AlternatingRowStyle CssClass="evenRow" />
                </asp:GridView>
            </div>
            <div>
                <asp:LinkButton ID="btnSave" ToolTip="Save Button" runat="server" OnClick="btnSave_Click"
                    CssClass="button"><span>Save</span></asp:LinkButton>
                <a href="ContractItem.aspx" title="Add contract between own and agent." class="button">
                    <span>Add contract</span></a>
            </div>
        </div>
        <%-- <div class="item">
            <div class="label">
                GuestType</div>
            <div class="field">
                <asp:DropDownList ID="ddlGuestType" runat="server">
                <asp:ListItem Value="0">Regular Agent</asp:ListItem>
                <asp:ListItem Value="1">Irregular Agent</asp:ListItem>
                <asp:ListItem Value="2">Walk-In</asp:ListItem>
                </asp:DropDownList>
            </div>
        </div>--%>
    </div>
</asp:Content>
